home *** CD-ROM | disk | FTP | other *** search
/ QuickTime for the Web (2nd Edition) / QuickTime for the Web (2nd Edition).iso / pc / AppleScript / QUICKTIME 5.0.2 SCRIPTS / Example Files / Frame Examples / Fades / Bckgnd Fade W2B.txt < prev    next >
Encoding:
Text File  |  2001-06-04  |  3.2 KB  |  83 lines

  1. property timescale : 600
  2. property fps : 15
  3. property fade_duration : 2 -- in seconds
  4. property display_text : (return & return & "2-Sec Background Fade" & return & "WHITE TO BLACK")
  5.  
  6. tell application "QuickTime Player"
  7.     launch
  8.     activate
  9.     stop every movie
  10.     try
  11.         -- CHECK FOR THE CORRECT VERSION
  12.         set QT_version to (QuickTime version as string)
  13.         set player_version to (version as string)
  14.         if (QT_version is less than "5.0") or ¬
  15.             (player_version is less than "5.0") then
  16.             error "This script requires QuickTime 5.0 or greater." & ¬
  17.                 return & return & ¬
  18.                 "Current QuickTime Version: " & QT_version & return & ¬
  19.                 "Current QuickTime Player Version: " & player_version
  20.         end if
  21.         -- CHECK FOR QUICKTIME PRO
  22.         if QuickTime Pro installed is false then
  23.             set the target_URL to "http://www.apple.com/quicktime/download/"
  24.             set the message_text to "This script requires QuickTime Pro." & return & return & ¬
  25.                 "If this computer is currently connected to the Internet, " & ¬
  26.                 "click the “Upgrade” button to visit the QuickTime Website at:" & ¬
  27.                 return & return & target_URL
  28.             display dialog message_text buttons {"Upgrade", "Cancel"} default button 2
  29.             ignoring application responses
  30.                 tell application "Finder"
  31.                     open location target_URL
  32.                 end tell
  33.             end ignoring
  34.             error number -128
  35.         end if
  36.         display dialog "Creating Fade Example…" buttons {"•"} default button 1 giving up after 2
  37.         make new movie
  38.         set position of window 1 to {144, 144}
  39.         make new track at movie 1 with data " "
  40.         set the frame_duration to (timescale / fps) div 1
  41.         set the frame_count to (fade_duration * fps)
  42.         tell movie 1
  43.             tell track 1
  44.                 set dimensions to {240, 180}
  45.                 tell frame 1
  46.                     set the dimensions to {240, 180}
  47.                     set the default font to "Geneva"
  48.                     set the default font size to 24
  49.                     set the background color to {65535, 65535, 65535}
  50.                     set the foreground color to {0, 0, 0}
  51.                     set the duration to the frame_duration
  52.                     set justification to center
  53.                     set antialias to true
  54.                 end tell
  55.             end tell
  56.             set the dialog_text to ("Adding " & (frame_count - 1) as string) & " Frames." & ¬
  57.                 return & return & "This will take a moment…"
  58.             display dialog dialog_text buttons {"•"} default button 1 giving up after 2
  59.             set the shade_increment to (65535 / frame_count) div 1
  60.             set the gradation_value to 65535 - shade_increment
  61.             repeat (frame_count - 1) times
  62.                 make new frame at track 1 with data display_text
  63.                 tell the last frame of track 1
  64.                     set the background color to {gradation_value, gradation_value, gradation_value}
  65.                     set the duration to the frame_duration
  66.                     set the default font to "Geneva"
  67.                     set the default font size to 18
  68.                     set the foreground color to {65535, 65535, 65535}
  69.                     set antialias to true
  70.                 end tell
  71.                 set gradation_value to (gradation_value - shade_increment)
  72.                 if the gradation_value is less than 0 then set gradation_value to 0
  73.             end repeat
  74.             set the full text of annotation "Full Name" to "2-Sec Bckgnd Fade • W2B"
  75.         end tell
  76.         display dialog "Process Completed." buttons {"•"} default button 1 giving up after 2
  77.     on error error_message number error_number
  78.         if the error_number is not -128 then
  79.             beep
  80.             display dialog error_message buttons {"Cancel"} default button 1
  81.         end if
  82.     end try
  83. end tell